//
//  ViewController.m
//  ProyectoMoviTiendas
//
//  Created by Daniel Paez on 3/6/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "ViewController.h"
#import "MoviTiendas.h"

@interface ViewController ()

@end

@implementation ViewController
@synthesize lblMensaje;
@synthesize btnEsquina;

- (void)viewDidLoad
{
    [super viewDidLoad];

    Cliente * cliente = [MoviTiendas darInstancia].cliente;
    if(cliente)
    {
      //  [self performSegueWithIdentifier:@"verPerfil" sender:self];
        lblMensaje.text = @"Bienvenido ";
        lblMensaje.text  = [lblMensaje.text stringByAppendingString:cliente.nombre];
        
        btnEsquina.title = @"Entrar";
        
        
    };
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
    [self setLblMensaje:nil];
    [self setBtnEsquina:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    //return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (IBAction)redirigirVista:(id)sender 
{
    if ([MoviTiendas darInstancia].cliente)
    {
         [self performSegueWithIdentifier:@"verPerfil" sender:self];
    }
    else {
         [self performSegueWithIdentifier:@"crearPerfil" sender:self];
    }
   
    
}

@end
